${C.packageName(T.SERVICE_IMPL)}
<#list C.importName(T.DOMAIN,T.DAO,T.SERVICE) as import>
${import}
</#list>
import org.springframework.stereotype.Service;
import cn.sh.ideal.portal.framework.exception.ServiceException;
import cn.sh.ideal.portal.framework.persistence.hibernate3.Where;
import cn.sh.ideal.portal.framework.persistence.util.Page;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
import cn.sh.ideal.portal.framework.util.Empty;
import cn.sh.ideal.portal.framework.exception.DaoException;
/**
* ${module}ServiceImpl处理类
* @author
*/
@Service
public class ${C.className(T.SERVICE_IMPL)} implements ${C.className(T.SERVICE)}{

    @Autowired
    private ${C.className(T.DAO)} ${S.firstToLowerCase(C.className(T.DAO))};

    @Override
    public ${C.className(T.DOMAIN)} findVO(String ${C.tableClass().pkName}) throws ServiceException {
        try {
            ${C.className(T.DOMAIN)} doc = (${C.className(T.DOMAIN)})this.${S.firstToLowerCase(C.className(T.DAO))}.get(${C.tableClass().pkName});
            return doc;
        } catch (Exception e) {
            e.printStackTrace();
            throw new ServiceException("获取${module}异常!");
        }
    }

    @Override
    public List<${C.className(T.DOMAIN)}> findList(Page page, Where where) throws ServiceException {
        try {
            @SuppressWarnings("unchecked")
            List<${C.className(T.DOMAIN)}> list = this.${S.firstToLowerCase(C.className(T.DAO))}.find(page, where);
                return list;
        } catch (Exception e) {
            e.printStackTrace();
            throw new ServiceException("获取${module}异常!");
        }
    }

    @Override
    public String save(${C.className(T.DOMAIN)} doc) throws ServiceException {
        try {
            this.${S.firstToLowerCase(C.className(T.DAO))}.save(doc);
            return doc.getId();
        } catch (Exception e) {
            e.printStackTrace();
            throw new ServiceException("保存${module}异常!");
        }
    }

    @Override
    public void del(String[] ${C.tableClass().pkName}s) throws ServiceException {
        try {
            this.${S.firstToLowerCase(C.className(T.DAO))}.delete(${C.tableClass().pkName}s);
        } catch (Exception e) {
            e.printStackTrace();
            throw new ServiceException("删除${module}异常!");
        }
    }

    @Override
    public void update(String ${C.tableClass().pkName}) throws ServiceException {
        String sql = "update oa_ot_application t set t.state = '3' where t.id ='"+${C.tableClass().pkName}+"'";
        try {
            this.${S.firstToLowerCase(C.className(T.DAO))}.executeSQL(sql,null);
        } catch (DaoException e) {
            e.printStackTrace();
        }
    }

    @Override
    public void delete(String ${C.tableClass().pkName}) throws ServiceException {
        try{
            if(!Empty.isEmpty(${C.tableClass().pkName})){
                String sql = "delete from ${tableName} where ${C.tableClass().pkName}='"+${C.tableClass().pkName}+"'";
                this.${S.firstToLowerCase(C.className(T.DAO))}.executeSQL(sql,null);
            }
        }catch (Exception e) {
            e.printStackTrace();
            throw new ServiceException("删除${module}异常!");
        }
    }

}